package com.fsm.demo.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author 
 * @since 
 */
public class ClientInfoTable extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final ClientInfoTable CLIENT_INFO = new ClientInfoTable();

    /**
     * id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 姓名
     */
    public final QueryColumn NAME = new QueryColumn(this, "name");

    /**
     * 是否存在数据(0、不存在；1、存在)
     */
    public final QueryColumn EXIST = new QueryColumn(this, "exist");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 修改时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 冻结状态（0：冻结；1：未冻结）
     */
    public final QueryColumn FREEZE_STATE = new QueryColumn(this, "freeze_state");

    /**
     * 审核时间
     */
    public final QueryColumn AUDITING_TIME = new QueryColumn(this, "auditing_time");

    /**
     * 审核状态（0：未审核；1：已通过；2：未通过）
     */
    public final QueryColumn AUDITING_STATE = new QueryColumn(this, "auditing_state");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, NAME, FREEZE_STATE, AUDITING_STATE, AUDITING_TIME, CREATE_TIME, UPDATE_TIME, EXIST};

    public ClientInfoTable() {
        super("", "client_info");
    }

    private ClientInfoTable(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public ClientInfoTable as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new ClientInfoTable("", "client_info", alias));
    }

}
